Gravity
With changes made to CS2, the old gravity attribute now became a block type of its own. Of course, this means no more cross texture blocks being gravity blocks or falling stairs. Fortunately though, this fixes the problems with blocks turning pure black like in CS1 while falling. Example (CS2 0.9.10 and above) mod.js config.addBlockIdProperty("enderSandID", 2514); mod.addBlock("enderSand.js", "gravity"); blocks/enderSand.js id = config.getBlockId("enderSandID"); name = "enderSand"; material = "sand"; stepSound = "sand"; creativeTab = "buildingBlocks"; //Normal gravity block displayName0 = "Ender Gravel"; hasAntiGravity0 = false; hardness0 = 5; resistance0 = 30; toolClass0 = "shovel"; harvestLevel0 = 1; textureFileXP0 = "enderGravel.png"; textureFileXN0 = "enderGravel.png"; textureFileYP0 = "enderGravel.png"; textureFileYN0 = "enderGravel.png"; textureFileZP0 = "enderGravel.png"; textureFileZN0 = "enderGravel.png"; addToCreative0 = true; //Antigravity block displayName1 = "Ender Sand"; hasAntiGravity1 = true; hardness1 = 5; resistance1 = 30; toolClass1 = "shovel"; harvestLevel1 = 1; textureFileXP1 = "enderSand.png"; textureFileXN1 = "enderSand.png"; textureFileYP1 = "enderSand.png"; textureFileYN1 = "enderSand.png"; textureFileZP1 = "enderSand.png"; textureFileZN1 = "enderSand.png"; addToCreative1 = true; Gravity Block Attributes Required Attributes * displayName * id * name * textureFileXN * textureFileXP * textureFileYN * textureFileYP * textureFileZN * textureFileZP Optional Attributes * addToCreative * canPlaceOnCeiling * canPlaceOnFloor * canPlaceOnWall * canSilkHarvest * creativeTab * drop * fireSpreadSpeed * flammability * fortuneModifier * hardness * harvestLevel * hasAntiGravity * hasCollision * hasTileEntity * isBeaconBase * isBurning * isFireSource * isWood * light * material * opacity * pick * resistance * semiTransparent * slipperiness * stepSound * tickrate * tileEntity * tileTransparent * toolClass * transparent textureFile and textureIndex In CS2 versions for 1.4.7 and below, CS2 0.9.9 or below, textureFile was used to specify the texture sheet and textureIndex was used for identifying the specific icon within the texture sheet. If using CS2 0.9.9 or lower, make sure to use both of these attributes. hasAntiGravity This is basically the same thing as the old gravity attribute from CS1, but can be set separately for each block id. The default is false, causing gravity blocks to fall downward. If changed to false, the block will fall upwards, disappearing into the sky if no block is above it. Bugs In 0.9.12d, gravity blocks will appear to suddenly jump about 3 blocks upward before they start to fall, regardless of if the block falls downward or upward. The gravity option will let you make the block turn into an entity and fall onto the highest stable block. In example, gravel on a ceiling will fall to the stone below. Basically, it's just like sand and gravel in the vanilla game. Example: This is the basic code to give gravity: gravity = "true"; To turn it off, use: gravity = "false"; Lastly, to make it 'fall' upwards, use: gravity = "reverse"; Bugs block turns black when falling.]]While you can add this attribute to most types of blocks, it's a bit glitchy when used on blocks not of the Normal or Simple types such as crosstexture, slab, pane, etc. As shown by the image at right, the falling block will turn into a black cube upon falling. This is because a falling object is not a block, it's an entity and only normal-type blocks convert to falling block entities correctly. Category:Bugs Category:Custom Stuff 2 Category:Block Types Category:Examples (CS2) Category:Examples